package com.usian.admin.controller;

import com.usian.model.common.dtos.ResponseResult;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;


@Component
public class HelloJob {

    @Value("${server.port}")
    private String appPort;

    @Autowired
    private AdNewsController adNewsController;

    @XxlJob("helloJob")
    public ReturnT<String> hello(String param) throws Exception {
        ResponseResult allByDate = adNewsController.findAllByDate();
        System.out.println(allByDate.getData());
        return ReturnT.SUCCESS;
    }
}

